package com.hxzy.shop.commodity.controller;

import com.hxzy.shop.commodity.dto.req.EditPrescriptionReviewSettingsReq;
import com.hxzy.shop.commodity.service.PrescriptionReviewSettingsService;
import com.hxzy.shop.entity.PrescriptionReviewSettings;
import com.hxzy.shop.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (PrescriptionReviewSettings)表控制层
 *
 * @author makejava
 * @since 2022-09-21 11:23:34
 */
@Api(tags = "商户处方审核配置")
@RestController
@RequestMapping("prescriptionReviewSettings")
public class PrescriptionReviewSettingsController {
    /**
     * 服务对象
     */
    @Resource
    private PrescriptionReviewSettingsService prescriptionReviewSettingsService;

    @ApiModelProperty("获取商户的处方审核配置")
    @PostMapping("/getPrescriptionReviewSettings")
    public Result<PrescriptionReviewSettings> getPrescriptionReviewSettings(){
        PrescriptionReviewSettings prescriptionReviewSettings =  prescriptionReviewSettingsService.getPrescriptionReviewSettings();
        return Result.success(prescriptionReviewSettings);
    }

    @ApiModelProperty("获取商户的处方审核配置")
    @PostMapping("/editPrescriptionReviewSettings")
    public Result<Boolean> editPrescriptionReviewSettings(@RequestBody EditPrescriptionReviewSettingsReq req){
        Boolean b =  prescriptionReviewSettingsService.editPrescriptionReviewSettings(req);
        return Result.success(b);
    }
    @ApiModelProperty("小程序获取商户的处方审核配置")
    @PostMapping("/appletPrescriptionReviewSettings")
    public Result<PrescriptionReviewSettings> appletPrescriptionReviewSettings(){
        PrescriptionReviewSettings prescriptionReviewSettings =  prescriptionReviewSettingsService.appletPrescriptionReviewSettings();
        return Result.success(prescriptionReviewSettings);
    }

}

